<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <input class="ins" type="text">
   <input class="ins_1" type="text"> 
   <input class="ins_2" type="text"> 
   <button class="but">输入</button>
  <script>
  var year = document.getElementsByClassName(`ins`)[0]
  var mon = document.getElementsByClassName(`ins_1`)[0]
  var day = document.getElementsByClassName(`ins_2`)[0]
  var but  = document.getElementsByClassName(`but`)[0]
  var num = 1;
  var res = 0;
   while(num<mon){
           var mst;
          switch(mon){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
               mst=31;
             break;
             case 2:{
                if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0){
                      mst=29;
                }else{
                       mst = 28 ;
                }
             } 
                case 4:
                case 6:
                case 9:
                case 11: 
                 mst = 30;
                 break;
             default:
                   alert(`输入错误  `)
                   break;

          }
           res += mst
           num++  
   } 
         var a = res+day
         alert(a)


  </script>
    


</body>
</html>